# Maintainer: kpcyrd <kpcyrd[at]archlinux[dot]org>

pkgname=python-flask-httpauth
_pkgname=Flask-HTTPAuth
pkgver=4.7.0
pkgrel=2
pkgdesc='Basic, Digest and Token HTTP authentication for Flask routes'
url='https://github.com/miguelgrinberg/Flask-HTTPAuth'
arch=('any')
license=('MIT')
depends=('python' 'python-flask' 'python-setuptools')
checkdepends=('python-pytest')
source=(https://github.com/miguelgrinberg/${_pkgname}/archive/v${pkgver}/${pkgname}-${pkgver}.tar.gz)
sha512sums=('d7bb3017aae0ef9b42b91e30ebf0d2686e7627fb6676e02ac32aa4d5fd91699570d55899ce190806c0a9da54e68516cfbf89155111266ab16c2d4e05bfbaa4ca')
b2sums=('e5687876e54c6a2942d82d73c706dd3961237d1ef25a6330c02a5aef62ebfd6aad23a87d59facb15c4322580eabcfde12be09eaf8ec487f6776d8af069c84b93')

build() {
  cd ${_pkgname}-${pkgver}
  python setup.py build
}

check() {
  cd ${_pkgname}-${pkgver}
  PYTHONPATH=src/ pytest -k "not async" tests/
}

package() {
  cd ${_pkgname}-${pkgver}
  python setup.py install --skip-build -O1 --root="${pkgdir}"
  install -Dm644 LICENSE -t "${pkgdir}/usr/share/licenses/${pkgname}"
}

# vim: ts=2 sw=2 et:
